package so.sao.code.service.infrastructure.enums;

import so.sao.top.core.util.enums.NamedEnumEntity;

public enum TagBatchType implements NamedEnumEntity<Integer> {

	NORMAL(1, "标准码"),

	ROLL(2, "卷标"),

	PACKAGE(3, "套标"),

	DUPLICATE(4, "双码");

	private Integer id;

	private String name;

	private TagBatchType(Integer id, String name) {
		this.id = id;
		this.name = name;
	}

	@Override
	public Integer getValue() {
		return id;
	}

	@Override
	public String getName() {
		return name;
	}

	public static TagBatchType fromValue(Integer id) {
		switch (id) {
		case 1:
			return NORMAL;
		case 2:
			return ROLL;
		case 3:
			return PACKAGE;
		case 4:
			return DUPLICATE;
		default:
			throw new IllegalArgumentException("Value [" + id + "] not support!");
		}
	}
}
